1. Field of the Invention
The present invention relates to a numerical controller.
2. Description of the Related Art
A workpiece needs to be placed horizontally on a workpiece placement table for high-accuracy processing using a wire electric discharge machining device. However, ideal placement of the workpiece in practice is not always possible. For example, it may happen that the workpiece is placed on the workpiece placement table without being horizontally placed due to dust remaining between the workpiece and the workpiece placement table or due to incorrect mounting of a tool for fixation of the workpiece. In view of these situations, as illustrated in FIG. 14, there are techniques of workpiece placement error correction according to which three representative points on the workpiece surface are measured by a touch sensor or the like and thereby the inclination of the workpiece is calculated, and then upper and lower wire guide positions are corrected (for example, see German Patent Application Laid-Open No. 4243392).
Also, Japanese Patent Laid-Open No. 08-243846 discloses a state of the art technique which uses electric discharging by making a wire and a workpiece close to each other and obtains the discharge position, thereby calculating the inclination of the wire electrode and performs the perpendicular setting of the wire. This state of the art technique makes it possible at the time of the wire perpendicular setting to obtain necessary date for the workpiece placement error correction and to correct the placement error of the workpiece.
However, when the workpiece placement error correction technique described in the German Patent Application Laid-Open No. 4243392 is used, it is difficult to use the technique when the workpiece surface is not smooth. For example, in a case where the placement error of a workpiece such as a casting whose workpiece surface is rough is corrected, even when it is attempted to calculate the inclination of the workpiece based on the three representative points, as illustrated in FIG. 15, the positions of the representative points obtained by the touch sensor is displaced due to the roughness, as a result of which an error due to roughness is included in the inclination of the workpiece calculated based on these positions, making it difficult to achieve accurate corrections.
Also, in a case where it is attempted to correct the placement error of the workpiece using the techniques disclosed in Japanese Patent Laid-Open No. 08-243846, it is possible to correct the inclinations of the wire electrode and the workpiece, but the disclosed techniques do not perform error correction that takes into account the accurate and strict positional relationship between the upper and lower wire guides and the portion to be subjected to the machining process of the workpiece, which implies that this technique has problems that needs to be addressed in terms of its accuracy.